console.log("消息中心ajax")
var host = `http://47.96.224.206:8080/CandyFirst/`

// url_message = "http://cnady.natapp1.cc/CandyFirst_war_exploded/message/index?tdsourcetag=s_pctim_aiomsg"
url_message = host + "message/index"


axios.get(url_message).then((res) => {
	console.log(res)
	console.log(res.data[0])
	for (var i = 0; i < res.data.length; i++) {
		time0=res.data[i].time//返回的毫秒数
		// console.log(Date.parse(new Date),time0)
		// console.log(Date.parse(new Date) - time0)
		d_s=(Date.parse(new Date) - time0)/1000
		//d_s相差多少秒
		if(d_s>3600*24){
			d_=parseInt(d_s/3600/24)+"天前"
		}else if(d_s>3600){
			d_=parseInt(d_s/3600)+"小时前"
		}else if(d_s>60){
			d_=parseInt(d_s/60)+"分钟前"
		}else{
			d_="不到1分钟"
		}
		//输出 d_ 就行,字符串
		
		mess.innerHTML += `
			<div class="message" onclick="javascript:location.href='../more/develop123.html'">
				<img src="${res.data[i].mesImage}" alt="">
				<div class="message_r">
					<h3>${res.data[i].title}
						<span>${d_}</span>
					</h3>
					
					<div>${res.data[i].content}
						<h6>${res.data[i].content==0}</h6>
					</div>
				</div>
			</div>
			
		`
	}
})

	// console.log(s70=Date.parse(str))

// console.log("----------------1970毫秒")
// ss="1534255825000"
// console.log(s70/1000/3600/24/365)
// var time70=new Date(s70)